import request from "@/api/request";
const userParam={
    "username": null,
    "status": null,
    "phone": null,
    "realName": null,
    "id": null,
    "sex": null,
    "size": 1,
    "email": null,
    "current": null
}
export default {
    // 获取用户信息
    getUserInfo:(param)=>{
        userParam.id=param
        return request({
            url:"/user/userInfo/list",
            method:"post",
            data: userParam,
        })
    },
    // 获得所有考试班级
    getAllExamClass:(params)=>{
        return request({
            url:"/exam/class/page",
            method:"post",
            data:params
        })
    },
    // 根据班级号获取考生
    getClassStudent:(params)=>{
        return request({
            url:"/exam/class/staff/get",
            method:"get",
            params:{classId:params}
        })
    },
    // 获得自己公司的所有培训班级
    getAllTrainClass:()=>{
        return request({
            url:"/train/train-class/all",
            method:"get"
        })
    },
    //根据培训班级号获取学生
    getInviteCode:(params)=>{
        return request({
            url:`/train/train-class/get/inviteCode/${params.id}`,
            method:"get",
        })
    },
    // 根据培训班级号获取考生
    getTrainStudent:(params)=>{
        return request({
            url:"/train/train-class-user/page-all-user",
            method:"post",
            data:params
        })
    },
    //获取一个班所有学生
    getOneTrainClass:(params)=>{
        return request({
            url:"/train/train-class-user/all-user",
            method:"get",
            params:{"trainClassId":params.trainClassId}
        })
    },
    addClassStudent:(classId,userIds)=>{
        return request({
            url:"/exam/class/staff/add",
            method:"post",
            params:{classId:classId,userIds:userIds}
        })
    },
    //获取考试班的人员详情
    getExamClassStudent:(params)=>{
        return request({
            url:"/exam/class/staff/page",
            method:"post",
            data:params
        })
    },
    //添加学生
    addExamStudnet:(params)=>{
        return request({
            url:"/exam/class/staff/add",
            method:"post",
            data:params
        })
    },
    //修改班级（修改）
    changeExamClass:(params)=>{
        return request({
            url:"/exam/class/update",
            method:"post",
            data:params
        })
    },
    //删除学生
    delExamStudent:(params)=>{
        return request({
            url:"/exam/class/staff/delete",
            method:"post",
            data:params
        })
    },
    /**
     * 获取考试人员
     */
    getExamPerson:()=>{
        return request({
            url:"exam/get",
            method:"get"
        })
    },
    /**
     * 创建考试
     */
    createExamClass:(params)=>{
        return request({
            url:"/exam/class/create",
            method:"post",
            data:params
        })
    },
    /**
     * 获取所有考试分页接口
     */
    getAllExamPage:(params)=>{
        return request({
            url:"/exam/page",
            method:"post",
            data:params
        })
    },
    /**
     * 更新考试
     */
    updateExam:(params)=>{
        return request({
            url:"/exam/page",
            method:"post",
            data:params
        })
    },
    /**
     * * 获得某个班级
     * @param params
     * @returns {*}
     */
    getClassInfo:(param)=> {
        return request({
            url: "/exam/class/get",
            method: "get",
            params: {
                classId:param
            }
        })
    },
    /**
     * 获得所有公司
     */
    getAllCompany:()=>{
        return request({
            url:"/common/getCompany",
            method:"get",
        })
    },

}
